<!--
 * @FilePath     : /study_code/vue2.x/slot-scope1.html
 * @Description  : 废弃语法1：slot 属性在 template 标签上定义具名插槽
 * @Date         : 2025-05-02 20:13:16
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-05-02 20:14:44
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="app">
      <base-layout>
        <template slot="header">
          <header>
            <h1>Here might be a page title</h1>
          </header>
        </template>

        <main>
          <p>A paragraph for the main content.</p>
          <p>And another one.</p>
        </main>

        <template slot="footer">
          <footer>
            <p>Here's some contact info</p>
          </footer>
        </template>
      </base-layout>
    </div>

    <script src="/vue/dist/vue.min.js"></script>
    <script src="./common.js"></script>
    <script>
      const myComponent = {
        template: `
        <div>
          <slot name="header"></slot>
          <slot></slot>
          <slot name="footer"></slot>
        </div>
      `,
      }

      var vm = new Vue({
        el: '#app',
        data: function () {
          return {}
        },
        components: {
          'base-layout': myComponent,
        },
      })

      /*
    <div class="container">
      <header>
        <h1>Here might be a page title</h1>
      </header>
      <main>
        <p>A paragraph for the main content.</p>
        <p>And another one.</p>
      </main>
      <footer>
        <p>Here's some contact info</p>
      </footer>
    </div>
    */
    </script>
  </body>
</html>
